<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>
        class Star {
            constructor(uname, age, sex) {
                this.name = uname;
                this.age = age;
                this.sex = sex;
            }
            sayHi() {
                console.log(this.name + this.age + " world!");
            }
        };
        class starDown extends Star {
            constructor(uname, age) {
                super(uname, age);
            }
            sayHi() {
                super.sayHi();
                console.log("hindm");
            }
        }
        var ldh = new Star("刘德华", 18, "男");
        var zxy = new Star("张学友", 20, "男");
        var dd = new starDown("黎明", 18);
        dd.sayHi()

        // console.log(ldh);
        // ldh.sayHi("hello");
    </script>
</body>

</html>